The present invention relates to an information processor such as a microprocessor which can translate instructions in an intermediate language into native instructions to be executed and more particularly to a technique effectively applicable to a microprocessor which includes a hardware accelerator for translating an intermediate language such as bytecodes into instructions specific to a microprocessor.
Recently, Java™ which can operate in a variety of apparatuses independently of particular hardware and platform such as operating system (OS) is widespread from large servers to portable telephones. Java is an object-oriented programming language similar to C++ developed by Sun Microsystems and “Java” is a registered trademark of Sun Microsystems.
Java is translated from source codes into an intermediate language named bytecodes that are independent of platform at the time of compiling. The bytecodes are interpreted into native codes specific to a microprocessor by means of software named a Java virtual machine (JVM) to be executed. By providing the Java virtual machine corresponding to a platform, difference in the platform is absorbed by the Java virtual machine.
Execution of the bytecodes by the Java virtual machine is slow since processing is made while the bytecodes are interpreted one by one by the interpreter system. The use of operand stacks in the interpreter system is inefficient due to multi-direction branch processing by bytecodes and one-by-one interpretation. Accordingly, in order to reduce the overhead caused by the interpretation processing, translation of bytecodes used frequently into native codes is performed by hardware (bytecode accelerator) to thereby attain high-speed operation. For example, U.S. Pat. No. 6,332,215 discloses hardware for translating bytecodes into native codes of a microprocessor. Complicated bytecodes used with low frequency are processed by means of the Java virtual machine of software.
JP-A-2004-30222 discloses that attention is paid to high-speed transition time between the hardware processing and the software Java virtual machine and when bytecodes cannot be translated into native codes by a bytecode accelerator, a dedicated bus is used to transfer data for internal information between registers of hardware accelerator and a register file of CPU when a translation operation mode is switched to the mode using the software Java virtual machine. In the case to the contrary, the internal information is transferred from the register file of CPU to the registers of the hardware accelerator.